<template>
  <router-view />
  <van-overlay
    :show="showLoading"
    z-index="9999"
    :custom-style="{ background: 'none' }"
  >
    <div id="loading">
      <van-loading
        color="white"
        type="spinner"
        size="1.2rem"
        text-size=".56rem"
        text-color="white"
        vertical
        >加载中...</van-loading
      >
    </div>
  </van-overlay>
</template>

<script>
import { mapState } from "vuex";

export default {
  computed: {
    ...mapState(["loading", "isLoading"]),
    showLoading() {
      return this.loading && this.isLoading;
    },
  },
};
</script>

<style lang="less">
::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

* {
  margin: 0;
  padding: 0;
}

body {
  height: 100%;
  background: rgba(244, 244, 244, 1);
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 3.52rem;
  max-width: 70%;
  min-height: 3.52rem;
  padding: 0.64rem;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0.32rem;
  transform: translate3d(-50%, -50%, 0);
  .flex(center, center);
  flex-direction: column;
  box-sizing: content-box;
}

.adapterMixin();
</style>
